import axios from 'axios'

export function requestIP() {
  let url = ''
  if (process.env.NODE_ENV === 'production') {
    url = 'http://pv.sohu.com/cityjson?ie=utf-8'
  }

  if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
    url = '/ip'
  }

  return axios.get(url)
}
